home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 172_01 / lex.h < prev    next >
Text File  |  1980-01-01  |  3KB  |  82 lines

  1. /*
  2.   HEADER: CUG    nnn.nn;
  3.   TITLE:         LEX - A Lexical Analyser Generator
  4.   VERSION:       1.1 for IBM-PC
  5.   DATE:          20 June 1986
  6.   DESCRIPTION:   A Lexical Analyser Generator. From UNIX
  7.   KEYWORDS:      Lexical Analyser Generator YACC C PREP
  8.   SYSTEM:        IBM-PC and Compatiables
  9.   FILENAME:      LEX.H
  10.   WARNINGS:      This program is not for the casual user. It will
  11.                  be useful primarily to expert developers.
  12.   CRC:           N/A
  13.   SEE-ALSO:      YACC and PREP
  14.   AUTHORS:       Scott Guthery 11100 leadfwood lane Austin, TX 78750
  15.   COMPILERS:     DESMET-C
  16.   REFERENCES:    UNIX Systems Manuals
  17. */
  18. /*
  19.  * Bob Denny 28-Aug-82  Remove reference to FILE *lexin to
  20.  *             eliminate dependency on standard I/O library. Only
  21.  *             lexgetc() used it, and it's there now.
  22.  *                      Add EOF definition for standalone uses.
  23.  *                      Corrected comment for llnxtmax.
  24.  *
  25.  * Scott Guthery 20-Nov-83      Adapt for IBM PC & DeSmet C.  Removed
  26.  *                      equivalence of yylval and lexval since
  27.  *                      a multi-typed parser wants yylval to be
  28.  *                      typed to be the union of the types (YYSTYPE).
  29.  * Andrew Ward 20 Jun 86  Modified to include special Cterp stdio lib
  30.  *                      and defined yytext and lexlast; values which YACC 
  31.  *            expects YYLEX to set.  Defined CMASK and the files
  32.  *            lexin and lexout.     
  33.  */
  34.  
  35. /*
  36.  * lex library header file -- accessed through
  37.  *      #include <lex.h>
  38.  */
  39.  
  40.  
  41. #ifdef C_terp
  42. #include "\lc\cterp\stdio.h"
  43. #else
  44. #include <stdio.h>
  45. #endif
  46.  
  47. /*
  48.  * Description of scanning tables. The entries at the front of
  49.  * the struct must remain in place for the assembler routines to find.
  50.  */
  51.  
  52. struct  lextab {
  53.     int     llendst;                /* Last state number            */
  54.     char    *lldefault;             /* Default state table          */
  55.     char    *llnext;                /* Next state table             */
  56.     char    *llcheck;               /* Check table                  */
  57.     int     *llbase;                /* Base table                   */
  58.     int     llnxtmax;               /* Last in next table           */
  59.     int     (*llmove)();            /* Move between states          */
  60.     int     *llfinal;               /* Final state descriptions     */
  61.     int     (*llactr)();            /* Action routine               */
  62.     int     *lllook;                /* Look ahead vector if != NULL */
  63.     char    *llign;                 /* Ignore char vec if != NULL   */
  64.     char    *llbrk;                 /* Break char vec if != NULL    */
  65.     char    *llill;                 /* Illegal char vec if != NULL  */
  66. };
  67.  
  68. #define NBPW             16
  69. #define LEXERR          256
  70. #define LEXSKIP         (-1)
  71. #define LEXECHO(fp) {lexecho((fp));}
  72. #define CMASK 0377
  73. #define lextext llbuf
  74. /* AMW: define yytext as llbuf and see if it works */
  75. #define yytext llbuf
  76. #define lexlast llend
  77.  
  78. extern char llbuf[];
  79. extern FILE *lexin;
  80. extern FILE *lexout;
  81. extern struct lextab *lexswitch( struct lextab * );
  82.